<!DOCTYPE html>
<html>
<head>
    <%if(data.length!=0){%>
    <%if(data[0].parent){%>
    <title><%=data[0].parent.name %></title>
    <%}else{%>
    <title><%=data[0].bookcase.name %></title>
    <%}%>
    <%}%>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <% include ../../common/public.ejs %>
    <link href="<%= global.config.path.publicPath %>/custom/css/articleTemplate.css" rel="stylesheet">
    <link rel="stylesheet" href="//cdn.bootcss.com/weui/1.1.1/style/weui.min.css">
    <link rel="stylesheet" href="//cdn.bootcss.com/jquery-weui/1.0.1/css/jquery-weui.min.css">
</head>
<body>
<link rel="stylesheet" href="//cdn.bootcss.com/weui/1.1.1/style/weui.min.css">
<link rel="stylesheet" href="//cdn.bootcss.com/jquery-weui/1.0.1/css/jquery-weui.min.css">
<img class="ca-bg" src="<%= global.config.path.publicPath %>/custom/images/catalogBackground.png" alt="">
<% let catalogs = data %>
<div class="ca-catalogContainer">
    <%if(catalogs.length!=0){%>
    <% for(let i = 0;i < catalogs.length;i++){ %>
    <%if(catalogs[i].bookcase){%>
    <a href="<%= catalogs[i].thirdUrl|| global.config.path.contextPath+'/fengqi/article/articleView/'+catalogs[i].code %>">
        <div class="ca-catalogList">
            <div class="ca-circleList" style="background: <%= catalogs[i].iconColor %>">
                <%if(catalogs[i].icon){%>
                <div class="weui-grid__icon  ">
                    <img src="<%= global.config.path.publicPath %>/uploadFiles<%= catalogs[i].icon.filePath||catalogs[i].img.filePath %>" alt="">
                </div>
                <%}else{%>
                <div class="weui-grid__icon">
                    <img src="<%= global.config.path.publicPath %>/uploadFiles<%=  catalogs[i].img.filePath %>" alt="">
                </div>
                <%}%>
            </div>
            <p class=" ca-weui-grid__label ca-font text-center" style="font-size: 16px;color: #727563;">
                <%= catalogs[i].name %>
            </p>
        </div>
    </a>
    <%}else{%>
    <a href="<%= global.config.path.contextPath %>/fengqi/article<%= catalogs[i].pageType %>?bookcase=<%= catalogs[i]._id %>">
        <div class="ca-catalogList">
            <div class="ca-circleList" style="background: <%= catalogs[i].iconColor %>">
                <%if(catalogs[i].icon){%>
                <div class="weui-grid__icon  ">
                    <img src="<%= global.config.path.publicPath %>/uploadFiles<%= catalogs[i].icon.filePath||catalogs[i].img.filePath %>" alt="">
                </div>
                <%}else{%>
                <div class="weui-grid__icon">
                    <%if(catalogs[i].img){%>
                    <img src="<%= global.config.path.publicPath %>/uploadFiles<%=  catalogs[i].img.filePath %>" alt="">
                    <%}%>
                </div>
                <%}%>
            </div>
            <p class="ca-weui-grid__label ca-font text-center" style="font-size: 16px;color: #727563;">
                <%= catalogs[i].name %>
            </p>
        </div>
    </a>
    <%}%>
    <% } %>
    <%}else{%>
    <img src="<%=global.config.path.publicPath%>/custom/images/icon/nomore.png" alt="" class="noMore">
    <h2 class="text-center">暂无更多内容啦</h2>
    <%}%>
</div>
<script src="//cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
<script src="//cdn.bootcss.com/jquery-weui/1.0.1/js/jquery-weui.min.js"></script>
<script src="//cdn.bootcss.com/jquery-weui/1.0.1/js/swiper.min.js"></script>
<script src="<%= global.config.path.publicPath %>/custom/js/articleTemplate.js"></script>
</body>
</html>
